package com.kingboy.kbg.devop.parser;

import com.github.javaparser.JavaParser;
import com.github.javaparser.ast.CompilationUnit;

import java.io.FileInputStream;

/**
 * Create By 郭金宝 on 2018/6/29.<br>
 */
public class CuPrinter {
    public static void main(String[] args) throws Exception {
        // creates an input stream for the file to be parsed
        FileInputStream in = new FileInputStream("D:\\source\\KBG\\kbg-biz-service\\kbg-devops\\devops-test\\src\\main\\java\\com\\kingboy\\kbg\\devop\\sonar\\SonarTest.java");

        CompilationUnit cu;
        try {
            // parse the file
            cu = JavaParser.parse(in);
        } finally {
            in.close();
        }

        // prints the resulting compilation unit to default system output
        System.out.println(cu.toString());
    }
}
